package a.f.h.e;

import a.c.*;
import a.c.e;
import a.f.j.ab;
import a.f.j.cb;
import a.f.j.p;
import a.f.q;
import a.i.db;

import java.util.Comparator;
import java.util.List;

public class c
  implements a.f.h.b.d
{
  public static final short b = 0;
  public static final short c = 1;
  private a.f.o d;
  private ab e;
  private a.f.o f;
  private cb g;
  private short h;
  private int i;
  private x j;
  private a.c.n k;
  private a.c.n l;
  private a.c.n m;
  public static boolean n;
  
  public void a(cb paramcb)
  {
    this.d = ((a.f.o)paramcb.a());
    this.e = paramcb;
  }
  
  public void a(short paramShort)
  {
    this.h = paramShort;
  }
  
  public void a(int paramInt)
  {
    this.i = paramInt;
  }
  
  public cb b()
  {
    return this.g;
  }
  
  public void a()
  {
    boolean bool = a.v;
    int i1 = a.u;
    a.f.j.n localn = this.e.c();
    a.c.d locald1 = localn.a().a();
    this.f = new q();
    this.g = new cb(this.f);
    this.j = db.a(new Object[this.d.j()]);
    this.k = db.b(new Object[this.d.l()]);
    Object localObject1 = this.d.v();
    Object localObject2;
    Object localObject3;
    do
    {
      if (!((a.c.w)localObject1).e()) {
        break;
      }
      if (bool) {
        break label233;
      }
      localObject2 = ((a.c.w)localObject1).d();
      if (i1 != 0) {
        break label226;
      }
      if (!bool)
      {
        if (((e)localObject2).e() < 5)
        {
          localObject3 = this.f.i();
          this.j.a(localObject2, localObject3);
        }
        ((a.c.w)localObject1).f();
      }
    } while (i1 == 0);
    this.l = db.b(new Object[this.d.l()]);
    this.m = db.b(new Object[this.d.l()]);
    if (!bool) {
      a(this.l, this.m);
    }
    label226:
    label233:
    a.c.w localw = this.d.v();
    Object localObject4;
    Object localObject5;
    Object localObject6;
    label457:
    do
    {
      do
      {
        if (!localw.e()) {
          break;
        }
        localObject1 = localw.d();
        if ((bool) || (((e)localObject1).e() != 0))
        {
          localm = ((e)localObject1).n();
          localObject2 = localm.a();
          localObject3 = (e)this.l.get(localObject2);
          localm.b();
          do
          {
            if (!localm.e()) {
              break label457;
            }
            localObject4 = localm.a();
            localObject5 = (e)this.l.get(localObject4);
            localObject6 = (e)this.m.get(localObject4);
            a.c.d locald2 = a((e)localObject3, (e)localObject5);
            if (i1 != 0) {
              break;
            }
            if (((e)localObject1).e() > 4) {
              this.j.a(localObject1, locald2);
            }
            localObject3 = (e)this.l.get(localObject4);
            a.c.d locald3 = this.f.a((e)localObject5, (e)localObject6);
            this.k.a(localObject4, locald3);
            if (!bool)
            {
              if (localObject4 == localObject2) {
                break label457;
              }
              localm.b();
            }
          } while (i1 == 0);
        }
        localw.f();
      } while (bool);
    } while (i1 == 0);
    m localm = this.d.w();
    label572:
    label578:
    do
    {
      if (!localm.e()) {
        break;
      }
      localObject1 = localm.a();
      if (i1 != 0) {
        break label630;
      }
      if (!bool)
      {
        if (this.e.h((a.c.d)localObject1))
        {
          if (bool) {
            break label578;
          }
          this.g.g((a.c.d)this.k.get(localObject1));
        }
      }
      else {
        if (i1 == 0) {
          break label572;
        }
      }
      this.g.o((a.c.d)this.k.get(localObject1));
      localObject2 = this.e.b((a.c.d)localObject1);
      this.g.a((a.c.d)this.k.get(localObject1), (a.c.d)this.k.get(localObject2));
      localm.f();
    } while (i1 == 0);
    label630:
    localObject1 = this.g.g();
    this.f.a("y.layout.orthogonal.general.NodeSplitter.NODE_FACES", (k)localObject1);
    try
    {
      this.g.f();
      localObject2 = (a.c.d)this.k.get(locald1);
      this.g.a(this.g.c((a.c.d)localObject2));
      localObject3 = this.g.b();
      do
      {
        if (!((a.f.j.o)localObject3).e()) {
          break;
        }
        ((p)localObject1).a(((a.f.j.o)localObject3).a(), false);
        if (bool) {
          break label896;
        }
        ((a.f.j.o)localObject3).f();
        if (i1 != 0) {
          break label889;
        }
      } while (i1 == 0);
      if (!bool)
      {
        localObject3 = this.d.v();
        do
        {
          if (!((a.c.w)localObject3).e()) {
            break;
          }
          localObject4 = ((a.c.w)localObject3).d();
          if ((!bool) && (i1 != 0)) {
            break label889;
          }
          if (!bool)
          {
            if (((e)localObject4).e() > 4)
            {
              localObject5 = (a.c.d)this.j.get(localObject4);
              localObject6 = this.g.c((a.c.d)localObject5);
              this.j.a(localObject4, localObject6);
              ((p)localObject1).a((a.f.j.n)localObject6, true);
            }
            ((a.c.w)localObject3).f();
          }
        } while (i1 == 0);
        if (!bool) {}
      }
      localo = this.g.b();
    }
    catch (Exception localException)
    {
      System.err.println("Internal Error in Face calculation !");
      localException.printStackTrace(System.err);
    }
    label889:
    label1017:
    label1019:
    do
    {
      a.f.j.o localo;
      do
      {
        if (!localo.e()) {
          return;
        }
        localObject3 = (a.f.j.n)localo.j();
        if (((p)localObject1).getBool(localObject3))
        {
          localObject4 = ((a.f.j.n)localObject3).a();
          do
          {
            if (!((m)localObject4).e()) {
              break;
            }
            localObject5 = ((m)localObject4).a();
            this.g.g(this.g.b((a.c.d)localObject5));
            this.g.o((a.c.d)localObject5);
            ((m)localObject4).f();
            if (bool) {
              break label1019;
            }
            if (i1 != 0) {
              break label1017;
            }
          } while (i1 == 0);
        }
      } while (bool);
      localo.f();
    } while (i1 == 0);
    label896:
  }
  
  private a.c.d a(e parame1, e parame2)
  {
    boolean bool = a.v;
    if (parame1.equals(parame2)) {
      return null;
    }
    a.c.d locald1 = this.f.a(parame1, parame2);
    m localm = parame2.n();
    a.c.d locald2;
    if (!bool)
    {
      if (!localm.e())
      {
        locald2 = this.f.a(parame2, parame1);
        if (bool) {
          break label110;
        }
        if (a.u == 0) {}
      }
      else
      {
        localm.f();
      }
    }
    else
    {
      a.c.d locald3 = localm.a();
      locald2 = this.f.a(parame2, locald3, parame1, null, 1, 0);
    }
    this.g.a(locald1, locald2);
    label110:
    return locald2;
  }
  
  private void a(a.c.n paramn1, a.c.n paramn2)
  {
    boolean bool = a.v;
    int i1 = a.u;
    Object localObject1 = this.d.v();
    Object localObject2;
    Object localObject3;
    label117:
    label119:
    do
    {
      do
      {
        if (!((a.c.w)localObject1).e()) {
          break label122;
        }
        localObject2 = ((a.c.w)localObject1).d();
        if (i1 != 0) {
          break label129;
        }
        localObject3 = ((e)localObject2).n();
        do
        {
          if (!((m)localObject3).e()) {
            break;
          }
          a.c.d locald = ((m)localObject3).a();
          e locale = a(locald);
          paramn1.a(locald, locale);
          ((m)localObject3).f();
          if (bool) {
            break label119;
          }
          if (i1 != 0) {
            break label117;
          }
        } while (i1 == 0);
      } while (bool);
      ((a.c.w)localObject1).f();
    } while (i1 == 0);
    label122:
    localObject1 = this.d.w();
    label129:
    do
    {
      if (!((m)localObject1).e()) {
        break;
      }
      localObject2 = ((m)localObject1).a();
      localObject3 = this.e.b((a.c.d)localObject2);
      paramn2.a(localObject2, paramn1.get(localObject3));
      paramn2.a(localObject3, paramn1.get(localObject2));
      ((m)localObject1).f();
    } while (i1 == 0);
  }
  
  private e a(a.c.d paramd)
  {
    boolean bool = a.v;
    if (!bool) {
      if (paramd.e().e() < 5)
      {
        locale = (e)this.j.get(paramd.e());
        if (bool) {
          break label54;
        }
        if (a.u == 0) {
          return locale;
        }
      }
    }
    e locale = this.f.i();
    label54:
    return locale;
    return locale;
  }
  
  public void c()
  {
    boolean bool = a.v;
    int i7 = a.u;
    x localx = this.d.B();
    Object localObject1 = this.d.v();
    Object localObject2;
    label195:
    label197:
    do
    {
      do
      {
        if (!((a.c.w)localObject1).e()) {
          break;
        }
        localObject2 = ((a.c.w)localObject1).d();
        z localz1 = new z();
        if (i7 != 0) {
          break label965;
        }
        if (((e)localObject2).e() > 4)
        {
          localObject3 = (a.f.j.n)this.j.get(localObject2);
          m localm1 = ((a.f.j.n)localObject3).a();
          do
          {
            if (!localm1.e()) {
              break;
            }
            a.c.d locald1 = localm1.a();
            localz1.add(this.f.o(locald1.e()));
            localm1.f();
            if (bool) {
              break label197;
            }
            if (i7 != 0) {
              break label195;
            }
          } while (i7 == 0);
        }
        Object localObject3 = (e)this.j.get(localObject2);
        if (!bool)
        {
          localz1.add(this.f.o((e)localObject3));
          localx.a(localObject2, localz1);
          ((a.c.w)localObject1).f();
        }
      } while (i7 == 0);
    } while (bool);
    localObject1 = this.d.v();
    label422:
    label423:
    label852:
    label855:
    do
    {
      if (!((a.c.w)localObject1).e()) {
        break;
      }
      localObject2 = ((a.c.w)localObject1).d();
      int i1 = 2147483647;
      int i2 = -2147483648;
      int i3 = 2147483647;
      int i4 = -2147483648;
      z localz2 = (z)localx.get(localObject2);
      if (bool) {
        break label964;
      }
      if (i7 != 0) {
        break label960;
      }
      Object localObject4 = localz2.h();
      if (((a.c.y)localObject4).e()) {}
      Object localObject5;
      while (bool)
      {
        localObject5 = (a.d.w)((a.c.y)localObject4).j();
        if (bool) {
          break label423;
        }
        if (i7 != 0) {
          break label422;
        }
        if (((a.d.w)localObject5).a() < i1) {
          i1 = (int)((a.d.w)localObject5).a();
        }
        if (!bool) {
          if (((a.d.w)localObject5).b() < i3) {
            i3 = (int)((a.d.w)localObject5).b();
          }
        }
        if (!bool) {
          if (((a.d.w)localObject5).a() > i2) {
            i2 = (int)((a.d.w)localObject5).a();
          }
        }
        if (!bool)
        {
          if (((a.d.w)localObject5).b() > i4) {
            i4 = (int)((a.d.w)localObject5).b();
          }
          ((a.c.y)localObject4).f();
        }
        if (i7 == 0) {
          break;
        }
      }
      if (this.h == 1)
      {
        this.d.b((e)localObject2, this.i * 0.5D, this.i * 0.5D);
        localObject4 = new bb();
        localObject5 = new bb();
        bb localbb1 = new bb();
        bb localbb2 = new bb();
        if ((bool) || (((e)localObject2).e() > 4))
        {
          a.f.j.n localn = (a.f.j.n)this.j.get(localObject2);
          m localm2 = localn.a();
          do
          {
            if (!localm2.e()) {
              break;
            }
            a.c.d locald2 = localm2.a();
            a.d.w localw = this.f.o(locald2.e());
            if (i7 != 0) {
              break label797;
            }
            if (localw.a() > i1)
            {
              if (bool) {
                break label671;
              }
              if (localw.a() < i2)
              {
                if (!bool) {
                  if (localw.b() == i3) {
                    ((bb)localObject4).add(new Integer((int)localw.a()));
                  }
                }
                if (bool) {
                  break label671;
                }
                if (localw.b() == i4) {
                  ((bb)localObject5).add(new Integer((int)localw.a()));
                }
              }
            }
            if (!bool)
            {
              if (localw.b() > i3)
              {
                if (bool) {
                  continue;
                }
                if (localw.b() < i4)
                {
                  if (!bool) {
                    if (localw.a() == i1) {
                      localbb1.add(new Integer((int)localw.b()));
                    }
                  }
                  if (bool) {
                    continue;
                  }
                  if (localw.a() == i2) {
                    localbb2.add(new Integer((int)localw.b()));
                  }
                }
              }
              localm2.f();
            }
          } while (i7 == 0);
          if (bool) {
            break label852;
          }
          int i5 = a((z)localObject4, (z)localObject5, i1, i2);
          int i6 = a(localbb1, localbb2, i3, i4);
          this.d.a((e)localObject2, i5, i6);
          if (bool) {
            break label855;
          }
          if (i7 == 0) {}
        }
        else
        {
          this.d.a((e)localObject2, i1, i3);
        }
      }
      if (!bool)
      {
        if (this.h == 0)
        {
          this.d.b((e)localObject2, i2 - i1 + this.i * 0.5D, i4 - i3 + this.i * 0.5D);
          this.d.c((e)localObject2, i1 - this.i * 0.25D, i3 - this.i * 0.25D);
        }
        ((a.c.w)localObject1).f();
      }
    } while (i7 == 0);
    label671:
    if (!bool) {
      this.g.o();
    }
    label797:
    label960:
    label964:
    if (this.h == 1)
    {
      label965:
      localObject1 = this.d.w();
      do
      {
        if (!((m)localObject1).e()) {
          break;
        }
        localObject2 = ((m)localObject1).a();
        List localList = this.f.l((a.c.d)this.k.get(localObject2)).g();
        if ((!bool) && (i7 != 0)) {
          break label1186;
        }
        if (!bool)
        {
          if (((a.c.d)localObject2).e().e() > 4) {
            localList.add(0, this.f.o((e)this.l.get(localObject2)));
          }
          if (bool) {}
        }
        else
        {
          if (((a.c.d)localObject2).f().e() > 4) {
            localList.add(this.f.o((e)this.m.get(localObject2)));
          }
          this.d.b((a.c.d)localObject2, new a.d.y(localList));
          this.d.a((a.c.d)localObject2, new a.d.w(0.0D, 0.0D));
          this.d.b((a.c.d)localObject2, new a.d.w(0.0D, 0.0D));
          ((m)localObject1).f();
        }
      } while (i7 == 0);
    }
    if (!bool)
    {
      if (this.h == 0)
      {
        label1186:
        localObject1 = this.d.w();
        do
        {
          if (!((m)localObject1).e()) {
            break;
          }
          localObject2 = ((m)localObject1).a();
          this.d.c((a.c.d)localObject2, this.f.o((e)this.l.get(localObject2)));
          this.d.d((a.c.d)localObject2, this.f.o((e)this.m.get(localObject2)));
          this.d.b((a.c.d)localObject2, this.f.l((a.c.d)this.k.get(localObject2)));
          ((m)localObject1).f();
          if ((!bool) && (i7 != 0)) {
            return;
          }
        } while (i7 == 0);
      }
      if (bool) {}
    }
    else
    {
      this.d.a(localx);
    }
  }
  
  private int a(z paramz1, z paramz2, int paramInt1, int paramInt2)
  {
    boolean bool = a.v;
    int i1 = a.u;
    z localz = new z();
    if (!bool) {
      if (paramz1.size() == 0)
      {
        if (bool) {
          break label54;
        }
        if (paramz2.size() == 0) {
          return (paramInt2 + paramInt1) / 2;
        }
      }
    }
    label54:
    if (!bool)
    {
      if (paramz1.size() > 0)
      {
        if (bool) {
          break label89;
        }
        if (paramz2.size() == 0) {
          return a(paramz1);
        }
      }
      if (bool) {
        break label111;
      }
    }
    if (paramz1.size() == 0)
    {
      label89:
      if (bool) {
        break label111;
      }
      if (paramz2.size() > 0) {
        return a(paramz2);
      }
    }
    label111:
    a.c.y localy = paramz1.h();
    Integer localInteger;
    do
    {
      do
      {
        if (!localy.e()) {
          break;
        }
        localInteger = (Integer)localy.j();
        localz.add(localInteger);
        localy.f();
        if (bool) {
          break label186;
        }
        if (i1 != 0) {
          break label179;
        }
      } while (i1 == 0);
    } while (bool);
    localy = paramz2.h();
    label179:
    label186:
    if (localy.e()) {}
    while (bool)
    {
      localInteger = (Integer)localy.j();
      if (!bool)
      {
        if (i1 != 0) {
          break label242;
        }
        localz.add(localInteger);
        localy.f();
      }
      if (i1 == 0) {
        break;
      }
    }
    label242:
    return a(localz);
  }
  
  private int a(z paramz)
  {
    boolean bool = a.v;
    int i2 = a.u;
    paramz.a(new Comparator()
    {
      public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
      {
        Integer localInteger1 = (Integer)paramAnonymousObject1;
        Integer localInteger2 = (Integer)paramAnonymousObject2;
        return l.a(localInteger1.intValue(), localInteger2.intValue());
      }
    });
    a.c.y localy = paramz.h();
    int i1 = 0;
    if (i1 < paramz.size() / 2) {}
    while (bool)
    {
      if (i2 != 0) {
        break label69;
      }
      localy.f();
      i1++;
      if (i2 == 0) {
        break;
      }
    }
    label69:
    return ((Integer)localy.j()).intValue();
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.h.e.c

 * JD-Core Version:    0.7.0.1

 */